import request from '@/utils/request'
import qs from 'qs'
const Host = process.env.VUE_APP_BASE_URL

export function publish(params) {
  return request({
    url: Host + '/TaskBLL/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ data: JSON.stringify(params) })
  })
}
export function edit(params) {
  return request({
    url: Host + '/TaskBLL/modify',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ data: JSON.stringify(params) })
  })
}

export function progress(params) {
  return request({
    url: Host + '/TaskBLL/teacherTaskCompletionStatus',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(params)
  })
}

export function list() {
  return request({
    url: Host + '/TaskBLL/selectAll',
    method: 'get'
  })
}

export function update(params) {
  return request({
    url: 'https://mobile-ms.uat.homecreditcfc.cn/mock/615a706b646d610027844050/tice/task/publish',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ data: JSON.stringify(params) })
  })
}

export function del(params) {
  return request({
    url: 'https://mobile-ms.uat.homecreditcfc.cn/mock/615a706b646d610027844050/tice/task/update', // Host + '/TaskBLL/del',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify({ data: JSON.stringify(params) })
  })
}

export function teacher() {
  return request({
    // 'https://mobile-ms.uat.homecreditcfc.cn/mock/615a706b646d610027844050/tice/task/list'
    url: Host + '/TaskBLL/selectCurrent',
    method: 'get'
  })
}
